package loggers

import (
	"context"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

// 简单日志实例
var simpleLogger *zap.Logger

func init() {
	simpleLogger = NewLogger("", "", zapcore.InfoLevel, MODE_CONSOLE)
}

// 注册实例到简单日志
func RegisterSimpleLogger(logger *zap.Logger) {
	simpleLogger = logger
}

func Info(mgs string, ctx context.Context, fields ...zapcore.Field) {
	simpleLogger.Info(mgs, fields...)
}

func Debug(mgs string, ctx context.Context, fields ...zapcore.Field) {
	simpleLogger.Debug(mgs, fields...)
}

func Warn(mgs string, ctx context.Context, fields ...zapcore.Field) {
	simpleLogger.Warn(mgs, fields...)
}

func Error(mgs string, ctx context.Context, fields ...zapcore.Field) {
	simpleLogger.Error(mgs, fields...)
}

func Fatal(mgs string, ctx context.Context, fields ...zapcore.Field) {
	simpleLogger.Fatal(mgs, fields...)
}
